/*------------------------------------------------------------------------------
 * PROJ : PrototypeWithSpring
 * NAME : sculove.spring.zzz.attachFile.model.AttachFileDto.java.java
 *        
 * Copyright 2009 sculove All rights reserved
 *------------------------------------------------------------------------------
 */
package sculove.spring.zzz.attachFile.model;

import org.springframework.validation.Errors;
import org.springframework.web.multipart.MultipartFile;

import sculove.spring.framework.common.AbstractDto;

/**
 * <pre>
 * sculove.spring.zzz.attachFile.model.AttachFileDto.java.java
 * 
 * TODO
 * 
 * </pre>
 * 
 * @date : 2009. 10. 24. ���� 8:06:40
 * @version :
 * @author : sculove
 */
public class AttachFileDTO extends AbstractDto {
	private MultipartFile file;
	private long fileNo;
	private short fileSeq;

	public MultipartFile getFile() {
		return file;
	}

	public void setFile(MultipartFile file) {
		this.file = file;
	}

	public long getFileNo() {
		return fileNo;
	}

	public void setFileNo(long fileNo) {
		this.fileNo = fileNo;
	}

	public short getFileSeq() {
		return fileSeq;
	}

	public void setFileSeq(short fileSeq) {
		this.fileSeq = fileSeq;
	}

	/**
	 * FileSize
	 * @return
	 */
	public long size() {
		return this.file.getSize();
	}
	
	public String filename() {
		logger.debug("FileName : " + file.getName());
		return file.getName();
	}
	
	public String orgFilename() {
		logger.debug("Org FileName : " + file.getOriginalFilename());
		return file.getName();
	}
	
	@Override
	public void validate(Object target, Errors errors) {
		// TODO Auto-generated method stub
	}
}
